---
title: InfrastructureLogging
sort: 20
contributors:
  - snitin315
---

Options for infrastructure level logging.

## infrastructureLogging.appendOnly

<Badge text="5.31.0+" />

`boolean`

Append lines to the output instead of updating existing output, useful for status messages. This option is used only when no custom [`console`](#infrastructureloggingconsole) is provided.

**webpack.config.js**

```javascript
module.exports = {
  //...
  infrastructureLogging: {
    appendOnly: true,
    level: 'verbose',
  },
  plugins: [
    (compiler) => {
      const logger = compiler.getInfrastructureLogger('MyPlugin');
      logger.status('first output'); // this line won't be overridden with `appendOnly` enabled
      logger.status('second output');
    },
  ],
};
```

## infrastructureLogging.colors

<Badge text="5.31.0+" />

`boolean`

Enable colorful output for infrastructure level logging. This option is used only when no custom [`console`](#infrastructureloggingconsole) is provided.

**webpack.config.js**

```javascript
module.exports = {
  //...
  infrastructureLogging: {
    colors: true,
    level: 'verbose',
  },
  plugins: [
    (compiler) => {
      const logger = compiler.getInfrastructureLogger('MyPlugin');
      logger.log('this output will be colorful');
    },
  ],
};
```

## infrastructureLogging.console

<Badge text="5.31.0+" />

`Console`

Customize the console used for infrastructure level logging.

**webpack.config.js**

```javascript
module.exports = {
  //...
  infrastructureLogging: {
    console: yourCustomConsole(),
  },
};
```

## infrastructureLogging.debug

`string` `boolean = false` `RegExp` `function(name) => boolean` `[string, RegExp, function(name) => boolean]`

Enable debug information of specified loggers such as plugins or loaders. Similar to [`stats.loggingDebug`](/configuration/stats/#statsloggingdebug) option but for infrastructure. Defaults to `false`.

**webpack.config.js**

```javascript
module.exports = {
  //...
  infrastructureLogging: {
    level: 'info',
    debug: ['MyPlugin', /MyPlugin/, (name) => name.contains('MyPlugin')],
  },
};
```

## infrastructureLogging.level

`string = 'info' : 'none' | 'error' | 'warn' | 'info' | 'log' | 'verbose'`

Enable infrastructure logging output. Similar to [`stats.logging`](/configuration/stats/#statslogging) option but for infrastructure. Defaults to `'info'`.

Possible values:

- `'none'` - disable logging
- `'error'` - errors only
- `'warn'` - errors and warnings only
- `'info'` - errors, warnings, and info messages
- `'log'` - errors, warnings, info messages, log messages, groups, clears. Collapsed groups are displayed in a collapsed state.
- `'verbose'` - log everything except debug and trace. Collapsed groups are displayed in expanded state.

**webpack.config.js**

```javascript
module.exports = {
  //...
  infrastructureLogging: {
    level: 'info',
  },
};
```

## infrastructureLogging.stream

<Badge text="5.31.0+" />

`NodeJS.WritableStream = process.stderr`

Stream used for logging output. Defaults to `process.stderr`. This option is used only when no custom [`console`](#infrastructureloggingconsole) is provided.

**webpack.config.js**

```javascript
module.exports = {
  //...
  infrastructureLogging: {
    stream: process.stderr,
  },
};
```

T> In the case of a TTY stream, `colors` is enabled and `appendOnly` is disabled, and vice versa.
